import QtQuick 2.12
import QtQuick.Controls 2.7
import QtQuick.Layouts 1.3
import Qt.labs.platform 1.1 as LAB11
import QtQuick.Dialogs 1.3 as QQD13

Page{
    id:root
    title: "Button"


    LAB11.MessageDialog{
        id:labMessage
        buttons: LAB11.MessageDialog.Ok
        text: "The document has been modified."
        onAccepted: {
          console.log("And of course you could only agree.")
        }
    }
    QQD13.MessageDialog{
        id:qqdMessage
        title: "May I have your attention please"
        text: "It's so cool that you are using Qt Quick."
        onAccepted: {
          console.log("And of course you could only agree.")
        }
    }

    //不可用---提示Dialog是cou抽象基类
//    LAB11.Dialog{
//        id:labDialog
//        title:"LAB Dialog!"
//    }

    LAB11.ColorDialog{
        id:labDialog
    }

    LAB11.FontDialog{
        id:fontDialog
    }

    QQD13.Dialog{
        id:qqdDialog
        title:"QQD Dialog!"
    }

    Dialog{
        id:sysDialog
        standardButtons: Dialog.Ok | Dialog.Cancel
        implicitWidth:200
        implicitHeight: 200
        onAccepted: console.log("Ok clicked")
        onRejected: console.log("Cancel clicked")
        title:"System Dialog!"
    }

    Action {
        id: _lab
        text: qsTr("lab")
        icon.source: "qrc:/image/icons/error.svg"
        onTriggered: labMessage.open()
    }
    Action {
        id: _qqd
        text: qsTr("Quick")
        icon.source: "qrc:/image/icons/error.svg"
        onTriggered: qqdMessage.open()
    }
    Action {
        id: _popup
        text: qsTr("系统dialog")
        icon.source: "qrc:/image/icons/error.svg"
        onTriggered: sysDialog.open()
    }
    Action {
        id: _message
        text: qsTr("Lab Color Dialog")
        icon.source: "qrc:/image/icons/error.svg"
        onTriggered: labDialog.open()
    }

    Action {
        id: _delete
        text: qsTr("QQD Dialog")
        icon.source: "qrc:/image/icons/error.svg"
        onTriggered: qqdDialog.open()
    }
    Action {
        id: _popInd
        text: qsTr("fontDialog")
        icon.source: "qrc:/image/icons/error.svg"
        onTriggered: fontDialog.open()
    }


    footer:ToolBar {
        Row {
            anchors.fill: parent
            spacing: 10
            ToolButton { action: _lab }
            ToolButton { action: _qqd }
            ToolButton { action: _popup }
            ToolButton { action: _message }
            ToolButton { action: _delete }
            ToolButton { action: _popInd }
        }
    }

}
